<div>
    <ul class="nav nav-tabs">
        <li class="blog-hot-title"><span></span></li>
        {% if  cate_list == "newest" %}
            <li class="active blog-hot-item"><a href="?cate=newest">最新文章</a></li>
            <li class="blog-hot-item"><a href="?cate=most_view">热门文章</a></li>
        {% elif cate_list == "most_view" %}
            <li class=" blog-hot-item"><a href="?cate=newest">最新文章</a></li>
            <li class="active blog-hot-item"><a href="?cate=most_view">热门文章</a></li>
        {% endif %}
    </ul>
</div>
<div class="blog-list-block">
    <div class="news-list-item-b clearfix">
        <div class="article-list" id="article-list">
            {% for blog in displayed_blog.object_list %}
                <div class="item">
                    <a href="{% url 'blogDetail' blog.category.parent.url_slug blog.category.url_slug   %}?blog={{ blog.url_slug }}" class="title">{{ blog.title }}</a>
                    <div class="status">
                        发布于:{{ blog.created_time }}|阅读:{{ blog.views }}|分类:
                        <a  class="label label-default" href="{% url 'blogDetail' blog.category.parent.url_slug blog.category.url_slug   %}">{{ blog.category.name }}</a>
                    </div>
                    <div class=" content"> {{ blog.desc }}
                    </div>
                </div>
            {% endfor %}
            {% if  cate_list == "newest" %}
                <ul id="newest" class="pager">
            {% elif cate_list == "most_view" %}
                <ul id="most_view" class="pager">
            {% endif %}
            {% if displayed_blog.has_previous %}
                <li id="blog{{ displayed_blog.previous_page_number.querystring | slice:'-1:' }}" class="prev"><a
                        href="?{{ displayed_blog.previous_page_number.querystring }}">上一页</a></li>
            {% else %}
                <li><span class="disabled prev">上一页</span></li>
            {% endif %}
            {% for page in displayed_blog.pages %}
                {% if page %}
                    {% ifequal page displayed_blog.number %}
                        <li class="active"><span>{{ page }}</span></li>
                    {% else %}
                        <li id="blog{{ page.querystring|slice:'-1:' }}"><a href="?{{ page.querystring }}"
                                                                           class="page">{{ page }}</a></li>
                    {% endifequal %}
                {% else %}
                    ...
                {% endif %}
            {% endfor %}
            {% if displayed_blog.has_next %}
                <li id="blog{{ displayed_blog.next_page_number.querystring|slice:'-1:' }}"><a
                        href="?{{ displayed_blog.next_page_number.querystring }}" class="next">下一页</a></li>
            {% else %}
                <li><span class="disabled next">下一页</span></li>
            {% endif %}
            </ul>
        </div>
    </div>
</div>
<script>
    $(".blog-hot-item a").each(function () {
            $(this).click(
                function (event) {
                    event.preventDefault();
                    cate = $(this).attr("href").split("=")[1]
                    getlist(1, cate);
                })
        }
    );
    $(".pager li a").each(function () {
            $(this).click(
                function (event) {
                    event.preventDefault();
                    cate = $(".pager").attr("id")
                    pagetemp = $(this).attr("href").split("=")[1]
                    page = Number(pagetemp)
                    getlist(page, cate);
                })
        }
    );
</script>